package com.ygxsk.carhome.ui.adapter;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ygxsk.carhome.R;
import com.ygxsk.carhome.response.SmartGoVerifiBean;
import com.ygxsk.carhome.utils.CommUtils;

import java.util.List;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-07-18  16:03
 * @Description:智能出门的核销适配器
 */
public class SmartGoVerifiAdapter extends BaseQuickAdapter<SmartGoVerifiBean, BaseViewHolder> {


    public SmartGoVerifiAdapter(int layoutResId, @Nullable List<SmartGoVerifiBean> data) {
        super(layoutResId, data);

        //设置点击事件；
//        addChildLongClickViewIds(//
//                R.id.textviewrepairintostation//
//                , R.id.textviewbookingchange,//
//                R.id.textviewbookingcancel);//

    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, SmartGoVerifiBean complainItemBean) {

        if (complainItemBean != null) {

            //设置item数据；

            //客户的姓名 以及其他信息
            String customerPerson = complainItemBean.getCustomerPerson();
            //卡券的信息 以及其他信息
            String cardInfo = complainItemBean.getCardInfo();
            //核销人
            String workerPerson = complainItemBean.getWorkerPerson();
            //核销的时间
            String workerTime = complainItemBean.getWorkerTime();
            //备注信息
            String remark = complainItemBean.getRemark();

            //findViews
            //和弦人员个人的名字
            TextView textviewDistCustomerName = (TextView) baseViewHolder.getView(R.id.textviewdistcustomernamesmart);
            //这个卡券的信息；
            TextView textViewCardDistInfo = (TextView) baseViewHolder.getView(R.id.textviewcarddistinfosmart);
            //核销人的内容；
            TextView textVieDistWokerPerson = (TextView) baseViewHolder.getView(R.id.textviedistwokerpersonsmart);
            //核销时间
            TextView textViewDistTime = (TextView) baseViewHolder.getView(R.id.textviewdisttimesmart);
            //核销时间
            TextView textViewDistRemark = (TextView) baseViewHolder.getView(R.id.textviewdistremarksmart);

            CommUtils.setText(textviewDistCustomerName, customerPerson);
            CommUtils.setText(textViewCardDistInfo, cardInfo);
            CommUtils.setText(textVieDistWokerPerson, workerPerson);
            CommUtils.setText(textViewDistTime, workerTime);
            CommUtils.setText(textViewDistRemark, remark);

        }
    }
}
